home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part2 / 11269 < prev    next >
Encoding:
Text File  |  1996-08-05  |  785 b   |  37 lines

  1. Path: ix.netcom.com!netnews
  2. From: mjudge@ix.netcom.com(Michael Judge )
  3. Newsgroups: comp.lang.c++
  4. Subject: Re: mixing static and const qualifiers for class members
  5. Date: 13 Mar 1996 16:52:26 GMT
  6. Organization: Netcom
  7. Message-ID: <4i6uga$67v@cloner3.netcom.com>
  8. References: <4i6mu3$pmg@halon.vggas.com>
  9. NNTP-Posting-Host: bst-ma3-13.ix.netcom.com
  10. X-NETCOM-Date: Wed Mar 13  8:52:26 AM PST 1996
  11.  
  12. In <4i6mu3$pmg@halon.vggas.com> JYoungman@vggas.com (James Youngman)
  13. writes: 
  14. >
  15. >How do I declare and initialise a one-per-class constant?  I want to
  16. do 
  17. >something like this:
  18. >
  19. >class Foo
  20. >{
  21. >    static const int nPositions = 6;
  22. >    int nData[nPositions];
  23. >}
  24. >
  25. >...how is this done?
  26. >James.
  27. >
  28.  
  29. class Foo
  30. {
  31.     enum {nPositions=6};
  32.     int nData[nPositions];
  33. };
  34.  
  35. Michael Judge
  36. mjudge@ix.netcom.com
  37.